// 引入模块
const express = require('express');
const bodyparser = require('body-parser');
const ejs = require('ejs');
const session = require('express-session');
// 创建服务器
const app = express();
// 配置静态资源目录
app.use(express.static('public'));

app.use(bodyparser.urlencoded({
   extended: false
}))
app.use(session({
   secret: 'gaoyuan',//加密字符串
   resave: false,//是否储存
   saveUninitialized: true,//在用户没有登录成功之前  发不发session
}))
// 配置模板引擎
app.set('view engine', 'ejs');
app.set('views', './views');

// 路由
// 注册
const gy_refisterRoute = require('./routers/gy_registerRout');
app.use(gy_refisterRoute);
// 登录
const gy_loginRoute = require('./routers/gy_loginRout');
app.use(gy_loginRoute);
//前端路由
const zlg_indexRout = require('./routers/zlg_indexRout');
app.use(zlg_indexRout);
// 项目路由
const zlg_mangeRout = require('./routers/zlg_mangeRout');
app.use(zlg_mangeRout);
// 我的知识路由
const lyj_knowledgeRout = require('./routers/lyj_knowledgeRout');
app.use(lyj_knowledgeRout);
// 分类设置路由
const lyj_knowledge_setRout = require('./routers/lyj_knowledge_setRout');
app.use(lyj_knowledge_setRout);
// crm添加用户的路由
const gy_addRoute=require('./routers/gy_useraddRoute');
app.use(gy_addRoute)
// 添加我的文档
const ryy_documentRout = require('./routers/ryy_documentRout');
app.use(ryy_documentRout);
// 审批显示
const lyd_approvalRoute = require('./routers/lyd_approvalRouter');
app.use(lyd_approvalRoute);
// 审批添加
const lyd_backstageRoute = require('./routers/lyd_backstageRouter'); 
app.use(lyd_backstageRoute);
// lcs路由
const lcs_resumerouter = require("./routers/lcs_resumerouter");
app.use(lcs_resumerouter);
const yyl_system = require('./routers/yyl.system');
app.use(yyl_system);
// 端口
app.listen(8080, () => {
   console.log('http://127.0.0.1:8080');
})